home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////
- // C O M P O U N D N U M B E R S //
- /////////////////////////////////////
-
- Copyright(c) 1992 Azarona Software. All rights reserved.
-
- The associated files implement a compound number class (ie., numbers
- consisting of a whole part, and a fractional part.) This code was
- created as part of work done to update my popular book "Turbo C++:
- A Self-Teaching Guide", B. Flamig, (John Wiley & Son's), of which
- a 2nd edition is in the works.
-
- The compound numbers are implemented as a "concrete data type",
- with all arithmetic and comparison operators implemented, (except
- for modulo "%", which I don't know to make sense of for fractions.)
- The numbers are kept simplified, and the notion of an "undefined"
- number is implemented, which is used to signal divide by zero.
- The code is elegant and efficient, and was written to reduce the
- possibility of overflows during calculations. However, overflows
- are not completely eliminated, and are not checked for.
-
- The code was tested with BC++ 3.0.
-
- You may use the files listed below freely, AS LONG AS
- YOU KEEP THE COPYRIGHT NOTICES INTACT.
-
- README // This readme file
- RATIONAL.H // Header file for rational number class
- RATIONAL.CPP // Implementation of rational number class
- COMPOUN.H // Header file for compound number class
- COMPOUN.CPP // Implementation of compound number class
- RTST.CPP // Test program for rational numbers
- RTST.MAK // Make file to build test program
- CTST.CPP // Test program for compound numbers
- CTST.MAK // Make file to build test program
-
- Since this code is going into a book, PLEASE REPORT ANY ERRORS
- YOU FIND TO:
-
- Bryan Flamig
- Azarona Software
- P.O. Box 768
- Conifer, CO 80433
-
- FAX: (303) 697-1728
- CS: [73057,3172]
- BIX: bflamig
-